Interface: Analyzer
Hierarchy
↳
Analyzer
Properties
fftSize
• fftSize: number
frequencyBinCount
• Readonly
frequencyBinCount: number
maxDecibels
• maxDecibels: number
minDecibels
• minDecibels: number
node
• Readonly
node: AnalyserNode
smoothingTimeConstant
• smoothingTimeConstant: number
Methods
connect
▸ connect(destinationNode
, output?
, input?
): AudioNode
Parameters
Name | Type |
---|---|
destinationNode | AudioNode |
output? | number |
input? | number |
Returns
AudioNode
Inherited from
BaseAudioNode.connect
▸ connect(destinationParam
, output?
): void
Parameters
Name | Type |
---|---|
destinationParam | AudioParam |
output? | number |
Returns
void
Inherited from
BaseAudioNode.connect
disconnect
▸ disconnect(): void
Returns
void
Inherited from
BaseAudioNode.disconnect
▸ disconnect(output
): void
Parameters
Name | Type |
---|---|
output | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
▸ disconnect(destinationNode
): void
Parameters
Name | Type |
---|---|
destinationNode | AudioNode |
Returns
void
Inherited from
BaseAudioNode.disconnect
▸ disconnect(destinationNode
, output
): void
Parameters
Name | Type |
---|---|
destinationNode | AudioNode |
output | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
▸ disconnect(destinationNode
, output
, input
): void
Parameters
Name | Type |
---|---|
destinationNode | AudioNode |
output | number |
input | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
▸ disconnect(destinationParam
): void
Parameters
Name | Type |
---|---|
destinationParam | AudioParam |
Returns
void
Inherited from
BaseAudioNode.disconnect
▸ disconnect(destinationParam
, output
): void
Parameters
Name | Type |
---|---|
destinationParam | AudioParam |
output | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
getAverageVolume
▸ getAverageVolume(buffer
): number
Utility function to get the average volume from getByteFrequencyData
Remarks
This is a better option when you only need to get the volume in terms of performance and complexity.
Parameters
Name | Type |
---|---|
buffer | Float32Array |
Returns
number
getByteFrequencyData
▸ getByteFrequencyData(buffer
): void
Copies the current frequency data into a Uint8Array (unsigned byte array) passed into it.
The frequency data is composed of integers on a scale from 0 to 255.
Remarks
The bytes versions are not cheaper than the float version but provided for convenient: the byte version are computed from the float version, using simple quantization to 2^8 values ref. https://padenot.github.io/web-audio-perf/#analysernode
Parameters
Name | Type | Description |
---|---|---|
buffer | Uint8Array | Use provided buffer instead of creating a new one |
Returns
void
getByteTimeDomainData
▸ getByteTimeDomainData(buffer
): void
Copies the current waveform, or time-domain, data into a Uint8Array (unsigned byte array) passed into it.
If the array has fewer elements than the AnalyserNode.fftSize
, excess
elements are dropped.
If it has more elements than needed, excess elements are ignored.
Remarks
The bytes versions are not cheaper than the float version but provided for convenient: the byte version are computed from the float version, using simple quantization to 2^8 values ref. https://padenot.github.io/web-audio-perf/#analysernode
Parameters
Name | Type | Description |
---|---|---|
buffer | Uint8Array | Use provided buffer instead of creating a new one |
Returns
void
getFloatFrequencyData
▸ getFloatFrequencyData(buffer
): void
Copies the current waveform, or time-domain, data into Float32Array passed into it
Remarks
The buffer size should be the same as AnalyserNode.frequencyBinCount
Parameters
Name | Type | Description |
---|---|---|
buffer | Float32Array | Use provided buffer instead of creating a new one |
Returns
void
getFloatTimeDomainData
▸ getFloatTimeDomainData(buffer
): void
Copies the current waveform, or time-domain, data into Float32Array passed into it
Remarks
The buffer size should be the same as AnalyserNode.fftSize
Parameters
Name | Type | Description |
---|---|---|
buffer | Float32Array | Use provided buffer instead of creating a new one |
Returns
void